package com.lhl.fw.core.utils;

import com.lhl.fw.core.userinfo.UserInfo;

/**
 * @className: ThreadLocalUtil
 * @description: TODO 类描述
 * @author: king
 * @date: 2020-10-21 10:34
 **/
public class ThreadLocalUserInfoUtil {
    /**
     * 把解析jwt里面的数据放到线程变量
     */
    private static ThreadLocal<UserInfo> userInfoThreadLocal = new ThreadLocal<UserInfo>();

    public static UserInfo getUserInfoThreadLocal() {
        return userInfoThreadLocal.get();
    }

    public static void setUserInfoThreadLocal(UserInfo userInfo) {
        userInfoThreadLocal.set(userInfo);
    }
}